package com.zhangjun.taxconsumerorder82.service.Impl;

import com.zhangjun.entity.ComputedTax;
import com.zhangjun.entity.Result;
import com.zhangjun.taxconsumerorder82.feign.ComputeFeignService;
import com.zhangjun.taxconsumerorder82.service.TaxService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 张钧
 * @Description
 * @create 2022-09-20 19:43
 */
@Service
public class TaxServiceImpl implements TaxService {

	@Value("${eureka.instance.instance-id}")
	private String consumer;

	@Resource
	private ComputeFeignService computeFeignService;
	@Override
	public Result<ComputedTax> getTax(Long money) {
		Result<ComputedTax> computedTaxResult = computeFeignService.computeTax(money);
		ComputedTax data = computedTaxResult.getData();
		data.setConsumer(consumer);
		return computedTaxResult;
	}
}
